import { createSignal } from "solid-js";
import Button from "./Button";

/**
 * 基本状态示例
 */
export default function Counter() {
  const [count, setCount] = createSignal<number>(0);
  return (
    <div>
      <Button onClick={() => setCount(count() - 1)}>-</Button>
      {count()}
      <Button onClick={() => setCount((c) => c + 1)}>+</Button>
    </div>
  );
}
